#define   _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void SWAP(int arr[], int len)
{
	int left = 0;
	int right = len - 1;
	int tmp = 0;
	while (left < right)
	{
		while ((left < right) && (arr[left] % 2 == 1))
		{
			left++;
		}
		while ((left < right) && (arr[right] % 2 == 0))
		{
			right--;
		}
		if (left < right)
		{
			tmp = arr[left];
			arr[left] = arr[right];
			arr[right] = tmp;
		}
	}
	
}
int main()
{
	int arr[] = { 1,2,3,5,6,4,16,15,11,10 };
	int len = sizeof(arr) / sizeof(arr[0]);
	SWAP(arr,len);
	for (int i = 0; i < len; i++)
		printf("%d ", arr[i]);
	return 0;
}